package models

import (
	"github.com/astaxie/beego/orm"
	// "github.com/astaxie/beego/session"
	// "log"
)

type User struct {
	Id       int    `form:"-"`
	Username string `form:"username",orm:"size(100)"`
	Password string `form:"password",orm:"size(100)"`
}

func NewUser() *User {
	return &User{Username: "wayne", Password: "123"}
}

func (loginuser *User) UserLogin() bool {
	o := orm.NewOrm()
	err := o.Read(loginuser, "username", "password")
	if err != nil {
		return false
	}
	return true
}
